<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: SegLCD       (Segment LCD)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__seglcd.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">SegLCD (Segment LCD)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The Segment LCD Driver provides an API to configure and operate the MXLCD hardware block. </p>
<p>The MXLCD block can be flexibly configured to drive a variety of LCD glass at different voltage levels with multiplex ratios.</p>
<p>Features:</p><ul>
<li>Digital Correlation and PWM at 1/2, 1/3, 1/4 and at 1/5 bias modes are supported</li>
<li>Drives STN/TN LCD-glass with up to eight COMs (device specific)</li>
<li>30 to 150 Hz refresh rate</li>
<li>Supports both type A (standard) and type B (low-power) waveforms</li>
<li>The display pixel state can be inverted for a negative image</li>
<li>Operation in Deep Sleep Mode from ILO/MFO</li>
<li>All-digital contrast control using "Dead Period" digital modulation</li>
<li>A set of basic standard displays and fonts</li>
<li>The customizable display and font structures.</li>
</ul>
<h1><a class="anchor" id="group_seglcd_glossary"></a>
Glossary</h1>
<ul>
<li>LCD - Liquid Crystal Display</li>
<li>Glass - An LCD glass with one or more displays (e.g. one 7-segment display and one bar-graph display).</li>
<li>TN - A twisted nematic LCD glass.</li>
<li>STN - A super-twisted nematic LCD glass.</li>
<li>Display - A block of the same type of symbols on an LCD glass to indicate a multi-digital number or character string. There may be one or more displays on a single LCD glass.</li>
<li>Symbol - A block of pixels on an LCD glass to indicate a single digit or character.</li>
<li>Pixel - A basic displaying item. This can be a segment of a 7-segment symbol (thus called a "segment"), a pixel of a dot-matrix display, or a stand-alone arbitrarily-shaped display element. Each pixel has a unique set of common and segment lines within one LCD glass. The API offers pixel identifiers - the 32-bit items of the display pixel map (to use in the display structure definition, see <a class="el" href="structcy__stc__seglcd__disp__t.html">cy_stc_seglcd_disp_t</a>), created by the <a class="el" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a> macro.</li>
<li>Common line (Com/COM for short) - A common wire/signal from the PSoC chip to the LCD glass. The API offers common line identifiers - the 32-bit items of the commons array (to use in <a class="el" href="group__group__seglcd__functions__frame.html#ga7f6bb5486ade2f8fe07ae883b1e59be2">Cy_SegLCD_ClrFrame</a> and <a class="el" href="group__group__seglcd__functions__frame.html#ga85e7982228c5bc991d43bbfbdb138d5c">Cy_SegLCD_InvFrame</a>), created by the <a class="el" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a> macro.</li>
<li>Segment line (Seg/SEG for short) - A segment wire/signal from the PSoC chip to the LCD glass.</li>
<li>Octet - A bunch of subsequent eight MXLCD terminals. Octets may not match GPIO ports.</li>
<li>Frame buffer - An array of registers to control the MXLCD signal generation for all the MXLCD terminals.</li>
</ul>
<h1><a class="anchor" id="group_seglcd_solution"></a>
SegLCD Solution</h1>
<p>The Segment LCD Driver can be used either as a standalone library to manage the MXLCD hardware or as a part of the more complex software solution delivered within ModusToolbox: the Device Configurator SegLCD personality and the SegLCD Configurator tools.</p>
<p>The SegLCD solution provides an easy method to configure an MXLCD block to drive your standard or custom LCD glass: </p><div class="image">
<img src="seglcd_solution.png" alt="seglcd_solution.png"/>
</div>
<p> The SegLCD solution includes:</p><ul>
<li>The SegLCD Configurator tool, which is a display configuration wizard to create and configure displays and generate commons array and display structures <a class="el" href="structcy__stc__seglcd__disp__t.html">cy_stc_seglcd_disp_t</a>.</li>
<li>The ModusToolbox Device Configurator contains a SegLCD personality, which is an MXLCD block configuration wizard. It helps to easily tune all the timing settings, operation modes, provides a flexible GPIO pin assignment capability and generates the <a class="el" href="structcy__stc__seglcd__config__t.html">cy_stc_seglcd_config_t</a> structure and the rest of accompanying definitions.</li>
<li>The SegLCD Driver API itself, which uses all the mentioned above generated code.</li>
</ul>
<h1><a class="anchor" id="group_seglcd_configuration"></a>
Configuration Considerations</h1>
<p>To start working with an LCD, first initialize the MXLCD block, then initialize the frame buffer, and then enable the block: </p><div class="fragment"><div class="line"><span class="comment">/* Scenario: Enable an LCD block */</span></div><div class="line"></div><div class="line"><a class="code" href="structcy__stc__seglcd__config__t.html">cy_stc_seglcd_config_t</a> config =</div><div class="line">{</div><div class="line">    .speed = <a class="code" href="group__group__seglcd__enums.html#ggab22a15df01ec018165a1a7e812f70bb0a280e1ebe0dce993105ffd2d6209055bb">CY_SEGLCD_SPEED_HIGH</a>,</div><div class="line">    .wave = <a class="code" href="group__group__seglcd__enums.html#gga255aa427b265f88cc6e618cdc5491248a5c1a7cd720aedee901d6527dd617f57b">CY_SEGLCD_TYPE_B</a>,</div><div class="line">    .drive = <a class="code" href="group__group__seglcd__enums.html#ggaff012223bec16a8c88dfdb39bd304893a1e4f051430063f293bdfc4ddbe32a27f">CY_SEGLCD_PWM</a>,</div><div class="line">    .bias = <a class="code" href="group__group__seglcd__enums.html#gga2b57420866b0307ca04c1e033790661ca3bac132675f4842763ee46417d83f3a1">CY_SEGLCD_BIAS_FOURTH</a>,</div><div class="line">    .lsClk = <a class="code" href="group__group__seglcd__enums.html#gga4e8bfe5d2149ea8d82ac609367709c95abadf62ab3037855e61b95e5a13be87bb">CY_SEGLCD_LSCLK_LF</a>,</div><div class="line">    .comNum = 8,</div><div class="line">    .frRate = 70,</div><div class="line">    .contrast = 70,</div><div class="line">  <span class="comment">/*.clkFreq is unknown here */</span></div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> uint32_t commons[8] =</div><div class="line">{</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_0, 0UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_1, 1UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_2, 2UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_3, 3UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_4, 4UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_5, 5UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_6, 6UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_COM_7, 7UL)</div><div class="line">};</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>If you use ModusToolbox Device Configurator, a SegLCD configuration structure is generated automatically into the GeneratedSource/cycfg_peripherals.h/.c files. All you need is just to call <a class="el" href="group__group__seglcd__functions__config.html#gae5bce733739f6bbe0a2aa9d2959f2a50">Cy_SegLCD_Init</a> with a pointer to the structure.</dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Then in executable code: */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Get the frequency of the assigned peripheral clock divider */</span></div><div class="line">    config.<a class="code" href="structcy__stc__seglcd__config__t.html#ad72440f94cfffb60d7223157722e5769">clkFreq</a>  = <a class="code" href="group__group__sysclk__clk__peripheral__funcs.html#ga366428a7c17da00f7a7ae025aeda2e23">Cy_SysClk_PeriphGetFrequency</a>(<a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>, 0U);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> == <a class="code" href="group__group__seglcd__functions__config.html#gae5bce733739f6bbe0a2aa9d2959f2a50">Cy_SegLCD_Init</a>(LCD0, &amp;config))</div><div class="line">    {</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> == <a class="code" href="group__group__seglcd__functions__frame.html#ga7f6bb5486ade2f8fe07ae883b1e59be2">Cy_SegLCD_ClrFrame</a>(LCD0, commons))</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__seglcd__functions__config.html#ga55eb3d853498593da4eb3cddaca073df">Cy_SegLCD_Enable</a>(LCD0);</div><div class="line">            </div><div class="line">           <span class="comment">/* Now the block generates LCD signals (all the pixels are off) and is ready to turn on any pixel</span></div><div class="line"><span class="comment">            * (or many pixels) using any of the frame/pixel/character/display management API functions.</span></div><div class="line"><span class="comment">            */</span></div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">        {</div><div class="line">            <span class="comment">/* error handling */</span></div><div class="line">        }</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><p> Contrast vs. Frame Rate (<a class="el" href="structcy__stc__seglcd__config__t.html#ae5789b3ceabe5f3944ad87fb9d896e0d">cy_stc_seglcd_config_t::contrast</a> vs. <a class="el" href="structcy__stc__seglcd__config__t.html#a5aa06fe4a2252a60e2e5b638cc9a49c7">cy_stc_seglcd_config_t::frRate</a>)<br />
Some combinations of a frame rate and input frequency can restrict the valid contrast range because of the limited dividers size (for Low Speed mode - 8 bit, and for High Speed mode - 16 bit). For small values of contrast at small frame rates, the required divider values may be beyond permissible limits of the dividers size. For large High Speed clock frequencies, certain ratios between the contrast and frame rate cannot be achieved due to the limited divider size. The <a class="el" href="group__group__seglcd__functions__config.html#gae5bce733739f6bbe0a2aa9d2959f2a50">Cy_SegLCD_Init</a> function automatically restricts such incorrect combinations (returns <a class="el" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a7c0638d12efd7e724155b9d294180f84">CY_SEGLCD_BAD_PARAM</a>). The peripheral clock divider can be adjusted to clock the LCD block with proper clock frequency: </p><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Enable peripheral clock divider for LCD operation with </span></div><div class="line"><span class="comment">     * the 2MHz clock frequency at the PeriClk frequency 50MHz</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="group__group__sysclk__clk__peripheral__funcs.html#gae7042898b1b6835673182e462be6976e">Cy_SysClk_PeriphSetDivider</a>(<a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>, 0U, 24U);</div><div class="line">    <a class="code" href="group__group__sysclk__clk__peripheral__funcs.html#ga2f480c53ecec720ceed823b2692f1698">Cy_SysClk_PeriphAssignDivider</a>(PCLK_LCD_CLOCK, <a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>, 0U);</div><div class="line">    <a class="code" href="group__group__sysclk__clk__peripheral__funcs.html#ga0725e2b222edc601b7d3f56d86d4ff75">Cy_SysClk_PeriphEnableDivider</a>(<a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>, 0U);</div></div><!-- fragment --><p> Speed Mode Switching (<a class="el" href="structcy__stc__seglcd__config__t.html#a1be9b9b30d3113fe5c2ce54e6b837740">cy_stc_seglcd_config_t::speed</a>)<br />
The High Speed and Low Speed generators mostly duplicate each other, except that for MXLCD_ver1, the High Speed version has larger frequency dividers to generate the frame and sub-frame periods. This is because the clock of the High Speed block typically has a frequency 30-100 times bigger than the 32 KHz clock fed to the Low Speed block. For MXLCD_ver2, both High Speed and Low Speed generators have similar 16-bit dividers, because a possibility exists to source a Low Speed generator with a Medium Frequency clock (see <a class="el" href="group__group__sysclk__mf__funcs.html">Functions</a>) that may be much higher than 32 KHz ILO: </p><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Enable MFO for LCD operation with the 2MHz clock frequency</span></div><div class="line"><span class="comment">     * in Deep Sleep power mode </span></div><div class="line"><span class="comment">     */</span></div><div class="line">    <a class="code" href="group__group__sysclk__mf__funcs.html#ga283d5413436f7a9f05b24d52ac2026be">Cy_SysClk_MfoEnable</a>(<span class="keyword">true</span>);</div><div class="line">    <a class="code" href="group__group__sysclk__mf__funcs.html#ga54c1e75dcdea293cdfd2662ceffa26e0">Cy_SysClk_ClkMfSetDivider</a>(1UL);</div><div class="line">    <a class="code" href="group__group__sysclk__mf__funcs.html#ga195a613b088f27c5d7667a6fecb0bbbc">Cy_SysClk_ClkMfEnable</a>();</div></div><!-- fragment --><p>Switching between High Speed and Low Speed modes via the <a class="el" href="group__group__seglcd__functions__config.html#gae5bce733739f6bbe0a2aa9d2959f2a50">Cy_SegLCD_Init</a> function causes the dividers to reconfigure. Under possible restrictions related to certain ratios between contrast and frame rates (see Contrast vs. Frame Rate section above), switching between High Speed and the Low Speed modes via the <a class="el" href="group__group__seglcd__functions__config.html#gae5bce733739f6bbe0a2aa9d2959f2a50">Cy_SegLCD_Init</a> function may set new dividers values that don't give the same contrast value.</p>
<p>Driving Modes (<a class="el" href="structcy__stc__seglcd__config__t.html#afc91e08c26e68bfd0b7707f02ffe272c">cy_stc_seglcd_config_t::drive</a>)<br />
SegLCD supports the following operating modes:</p><ul>
<li>Digital Correlation - preferred for low clock speeds, low common lines count and low supply voltages.</li>
<li>PWM at 1/2, 1/3, 1/4 or 1/5 Bias - preferred for high clock speeds (e.g. over 1MHz), many common lines (e.g. over 4), and high voltages (e.g. 3.3V or higher). More precise preferences depend on a certain set of an LCD glass, power modes, the number of terminals, desired contrast/frame rate settings, etc.</li>
</ul>
<p>Conventional Waveforms (<a class="el" href="structcy__stc__seglcd__config__t.html#a6a9444555b4cc7d3c545a1272e28fc76">cy_stc_seglcd_config_t::wave</a>)<br />
Conventional LCD drivers apply waveforms to COM and SEG electrodes generated by switching between multiple different voltages. The following terms are used to define these waveforms:</p><ul>
<li>Duty: A driver operates in the 1/M-th duty when it drives M COM electrodes. Each COM electrode is effectively driven for the 1/M of the frame time.</li>
<li>Bias: A driver uses the 1/B-th bias when its waveforms use the voltage steps of (1/B)*VDRV.</li>
<li>Frame: A frame is the time length to address all segments. During a frame, the driver cycles through the commons in sequence. All segments receive 0V DC when measured over the length of an entire frame.</li>
<li>Type-A Waveform: The driver structures the frame into M sub-frames. COMi is addressed in sub-frame i.</li>
<li>Type-B Waveform: The driver structures the frame into 2M sub-frames. COMi is addressed in sub-frames i and M+i. The two sub-frames are inverse of each other. Typically, type-B waveforms are slightly more power-efficient because they contain fewer transitions.</li>
</ul>
<p>The following figures show the conventional waveforms for COM and SEG electrodes for the 1/3rd bias and 1/4th duty. Only COM0/COM1 and SEG0/SEG1 are drawn. Conventional Type-A Waveform Example: </p><div class="image">
<img src="seglcd_waveA.png" alt="seglcd_waveA.png"/>
</div>
<p> Conventional Type-B Waveform Example: </p><div class="image">
<img src="seglcd_waveB.png" alt="seglcd_waveB.png"/>
</div>
<p> The generalized waveforms for individual sub-frames for any duty and bias are illustrated in the following figure. Note that these use 6 different voltages at most(including VSS and VDRV). Conventional Waveforms - Generalized: </p><div class="image">
<img src="seglcd_waveGen.png" alt="seglcd_waveGen.png"/>
</div>
<p> The effective RMS voltage for on and off segments can be calculated using these waveforms: </p><div class="image">
<img src="seglcd_Voff.png" alt="seglcd_Voff.png"/>
</div>
 <div class="image">
<img src="seglcd_Von.png" alt="seglcd_Von.png"/>
</div>
<p> The resulting Discrimination Ratio (D) for various bias and duty combinations is illustrated in the following table. The bias choice (B) for each duty (M) with the highest possible value for D is colored green: </p><div class="image">
<img src="seglcd_descr.png" alt="seglcd_descr.png"/>
</div>
<p>Digital Correlation (<a class="el" href="group__group__seglcd__enums.html#ggaff012223bec16a8c88dfdb39bd304893a98d2e892e080eacd3e73a7f66d27e120">CY_SEGLCD_CORRELATION</a>)<br />
The principles of operation are illustrated by the example waveforms shown in the following figures. Digital Correlation Example - Type-A: </p><div class="image">
<img src="seglcd_DCA.png" alt="seglcd_DCA.png"/>
</div>
<p> Digital Correlation Example - Type-B: </p><div class="image">
<img src="seglcd_DCB.png" alt="seglcd_DCB.png"/>
</div>
<p> As illustrated, instead of generating bias voltages between the rails, this approach takes advantage of the LCD displays characteristic: the LCD segments' on-ness and off-ness degree is determined by the RMS voltage across the segments. In this approach, the correlation coefficient between any given pair of COM and SEG signals determines whether the corresponding LCD segment is On or Off. Thus, by doubling the base drive frequency of the COM signals in their inactive sub-frame intervals, the phase relationship of the COM and SEG drive signals can be varied to turn segments on and off - rather than varying the DC levels of the signals as is used in the conventional approaches.</p>
<p>PWM Drive (<a class="el" href="group__group__seglcd__enums.html#ggaff012223bec16a8c88dfdb39bd304893a1e4f051430063f293bdfc4ddbe32a27f">CY_SEGLCD_PWM</a>)<br />
This approach duplicates the multi-voltage drive signals of the conventional method with bias B using a PWM output signal together with the intrinsic resistance and capacitance of the LCD display to create a simple PWM DAC. This is illustrated in the following figure: </p><div class="image">
<img src="seglcd_PWM.png" alt="seglcd_PWM.png"/>
</div>
<p> To drive a low-capacitance display with an acceptable ripple and rise/fall time, using a 32-kHz PWM an additional external series resistance of 100 k - 1 M ohm is required. External Resistors are not required for PWM frequencies of greater than ~1 MHz. The exact frequency depends on the display capacitance, the internal ITO resistance of the ITO routing traces, and the drive impedance of the I/O pins. The PWM method works for any bias value (B). NOTE As B gets higher, a higher PWM step frequency is required to maintain the same PWM output frequency (the RC response of the LCD depends on the PWM output frequency, NOT the step frequency). The PWM approach may also be used to drive a 1/2-bias display. This has the advantage that PWM is only required on the COM signals, as SEG signals of a 1/2-bias display use only logic levels. Therefore, PWM 1/2-bias can be supported at 32 kHz using just four external resistors. The power consumption of the approach (even for 1/2 bias) is substantially higher than that of other methods. Therefore, it is recommended power-sensitive customers use Digital Correlation drive in Deep Sleep mode, and change to PWM mode to gain the advantage of better contrast/viewing angle on TN displays in Active or Sleep mode.</p>
<p>PWM1/2 LCD drive waveform: </p><div class="image">
<img src="seglcd_PWM2.png" alt="seglcd_PWM2.png"/>
</div>
<p> PWM1/3 LCD drive waveform: </p><div class="image">
<img src="seglcd_PWM3.png" alt="seglcd_PWM3.png"/>
</div>
<p>Digital Contrast Control<br />
In all modes, digital contrast control is available using the duty cycle/dead time method illustrated in the following figure: </p><div class="image">
<img src="seglcd_contrast.png" alt="seglcd_contrast.png"/>
</div>
<p> This illustration shows the principle for 1/3 bias and 1/4 duty implementation, but the general approach of reducing contrast by reducing the percentage of time the glass is driven can be generalized and applied to any drive method. In all cases, during the dead time, all COM and SEG signals are set to a logic "1" state.</p>
<p>When the block is configured, for further work with display, a display structure is needed: </p><div class="fragment"><div class="line"><span class="keyword">const</span> uint32_t displayPixMap[4][<a class="code" href="group__group__seglcd__enums.html#ggad9a3f6a9bdb312ad774c5e55d5f1847ca79a408d3cfb19f29f0cc34ca132d4d68">CY_SEGLCD_7SEG</a>] =</div><div class="line">{</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 0UL), <span class="comment">/* Seg: P11_2, Com: 0, symbol 0, pixel A */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 2UL), <span class="comment">/* Seg: P11_2, Com: 2, symbol 0, pixel B */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 5UL), <span class="comment">/* Seg: P11_2, Com: 5, symbol 0, pixel C */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 6UL), <span class="comment">/* Seg: P11_2, Com: 6, symbol 0, pixel D */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 4UL), <span class="comment">/* Seg: P11_2, Com: 4, symbol 0, pixel E */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 1UL), <span class="comment">/* Seg: P11_2, Com: 1, symbol 0, pixel F */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_2, 3UL), <span class="comment">/* Seg: P11_2, Com: 3, symbol 0, pixel G */</span></div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 0UL), <span class="comment">/* Seg: P10_3, Com: 0, symbol 1, pixel A */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 2UL), <span class="comment">/* Seg: P10_3, Com: 2, symbol 1, pixel B */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 5UL), <span class="comment">/* Seg: P10_3, Com: 5, symbol 1, pixel C */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 6UL), <span class="comment">/* Seg: P10_3, Com: 6, symbol 1, pixel D */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 4UL), <span class="comment">/* Seg: P10_3, Com: 4, symbol 1, pixel E */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 1UL), <span class="comment">/* Seg: P10_3, Com: 1, symbol 1, pixel F */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P10_3, 3UL), <span class="comment">/* Seg: P10_3, Com: 3, symbol 1, pixel G */</span></div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 0UL), <span class="comment">/* Seg: P11_1, Com: 0, symbol 2, pixel A */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 2UL), <span class="comment">/* Seg: P11_1, Com: 2, symbol 2, pixel B */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 5UL), <span class="comment">/* Seg: P11_1, Com: 5, symbol 2, pixel C */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 6UL), <span class="comment">/* Seg: P11_1, Com: 6, symbol 2, pixel D */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 4UL), <span class="comment">/* Seg: P11_1, Com: 4, symbol 2, pixel E */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 1UL), <span class="comment">/* Seg: P11_1, Com: 1, symbol 2, pixel F */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_1, 3UL), <span class="comment">/* Seg: P11_1, Com: 3, symbol 2, pixel G */</span></div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 0UL), <span class="comment">/* Seg: P11_0, Com: 0, symbol 3, pixel A */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 2UL), <span class="comment">/* Seg: P11_0, Com: 2, symbol 3, pixel B */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 5UL), <span class="comment">/* Seg: P11_0, Com: 5, symbol 3, pixel C */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 6UL), <span class="comment">/* Seg: P11_0, Com: 6, symbol 3, pixel D */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 4UL), <span class="comment">/* Seg: P11_0, Com: 4, symbol 3, pixel E */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 1UL), <span class="comment">/* Seg: P11_0, Com: 1, symbol 3, pixel F */</span></div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_P11_0, 3UL), <span class="comment">/* Seg: P11_0, Com: 3, symbol 3, pixel G */</span></div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><a class="code" href="structcy__stc__seglcd__disp__t.html">cy_stc_seglcd_disp_t</a> display =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__disp__t.html#a92e348e14cdae68278381927802b48fc">type</a>   = <a class="code" href="group__group__seglcd__enums.html#ggad9a3f6a9bdb312ad774c5e55d5f1847ca79a408d3cfb19f29f0cc34ca132d4d68">CY_SEGLCD_7SEG</a>,</div><div class="line">    .symNum = 4,</div><div class="line">    .invert = <span class="keyword">false</span>,</div><div class="line">    .pixMap = (uint32_t*)displayPixMap,</div><div class="line">    .font   = &amp;<a class="code" href="group__group__seglcd__globals.html#gae34abfe748d26d5b00018aa9b36ccc83">cy_segLCD_7SegFont</a></div><div class="line">};</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Using the SegLCD Configurator, display structures and the commons array are generated automatically into the GeneratedSource/cycfg_seglcd.h/.c files. </dd>
<dd>
Using SegLCD personality version 2.0 or later there is no more need to include cycfg_seglcd.h into the application code - it is already included into the generated cycfg.h file.</dd></dl>
<p>And now you can write multi-digit decimal and hexadecimal numbers and strings onto the initiated 7-segment display: </p><div class="fragment"><div class="line">        <span class="comment">/* Scenario: Write a decimal number starting at the most right symbol on display: */</span></div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__display.html#ga496bcaec24788a3dc0d81c8a1bac4064">Cy_SegLCD_WriteNumber</a>(LCD0, 12, 3, &amp;display, <span class="keyword">false</span>, <span class="keyword">false</span>))</div><div class="line">        {</div><div class="line">            <span class="comment">/* error handling */</span></div><div class="line">        }</div></div><!-- fragment --><p>after which the next image on the glass appears: </p><div class="image">
<img src="seglcd_12.png" alt="seglcd_12.png"/>
</div>
 <div class="fragment"><div class="line">        <span class="comment">/* Scenario: Write a hexadecimal number with trailing zeroes: */</span></div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__display.html#ga496bcaec24788a3dc0d81c8a1bac4064">Cy_SegLCD_WriteNumber</a>(LCD0, 12, 3, &amp;display, <span class="keyword">true</span>, <span class="keyword">true</span>))</div><div class="line">        {</div><div class="line">            <span class="comment">/* error handling */</span></div><div class="line">        }</div></div><!-- fragment --><div class="image">
<img src="seglcd_oooc.png" alt="seglcd_oooc.png"/>
</div>
<p>Or even manage separate LCD pixels: </p><div class="fragment"><div class="line"><span class="comment">/* Scenario: There is a heart-shaped sign on an LCD glass: */</span></div><div class="line"><span class="preprocessor">#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) </span><span class="comment">/* Seg: P11_6, Com: 7 */</span><span class="preprocessor"></span></div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Set a pixel (write a true value) */</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__frame.html#gadf8be6669270e3846e4922fa464ff9b5">Cy_SegLCD_SetPixel</a>(LCD0, HEART))</div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><p>after which the next image on the glass appears: </p><div class="image">
<img src="seglcd_heart.png" alt="seglcd_heart.png"/>
</div>
 <div class="fragment"><div class="line">    <span class="comment">/* Scenario: Clear a pixel (write a false value) */</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__frame.html#ga74e99b4c6da5170bece02f6b62facaf4">Cy_SegLCD_ClrPixel</a>(LCD0, HEART))</div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Invert a pixel (change the value to opposite) */</span></div><div class="line">    <a class="code" href="group__group__seglcd__functions__frame.html#ga2bf69a76b6a8179e17b968a1c2fc8973">Cy_SegLCD_InvPixel</a>(LCD0, HEART);</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Read a pixel value, do some action with it and write it back into the frame */</span></div><div class="line">    <span class="keywordtype">bool</span> pixelValue = <a class="code" href="group__group__seglcd__functions__frame.html#ga60ff7015c394c32846038a43a10d06ca">Cy_SegLCD_ReadPixel</a>(LCD0, HEART);</div><div class="line">    <a class="code" href="group__group__seglcd__functions__frame.html#ga162ed4b35dcc29acfdea0e6b3360b104">Cy_SegLCD_WritePixel</a>(LCD0, HEART, !pixelValue);</div></div><!-- fragment --><p> The basic use case of the bar-graph display type: </p><div class="fragment"><div class="line"><span class="comment">/* Scenario: There is a battery-shaped frame on an LCD glass: */</span></div><div class="line"><span class="preprocessor">#define FRAME (CY_SEGLCD_PIXEL(LCD_P12_6, 7UL)) </span><span class="comment">/* Seg: P12_6, Com: 7 */</span><span class="preprocessor"></span></div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#define BAR_LENGTH (4)</span></div></div><!-- fragment --><div class="fragment"><div class="line"><span class="keyword">const</span> uint32_t barGraphPixMap[BAR_LENGTH] =</div><div class="line">{</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_SEG_6,  7UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_SEG_5,  7UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_SEG_4,  7UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_SEG_2,  7UL)</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__seglcd__disp__t.html">cy_stc_seglcd_disp_t</a> barGraph =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__disp__t.html#a92e348e14cdae68278381927802b48fc">type</a>   = <a class="code" href="group__group__seglcd__enums.html#ggad9a3f6a9bdb312ad774c5e55d5f1847cac660b5c60c7dc831a436c914f4cfc9c4">CY_SEGLCD_BAR</a>,</div><div class="line">    .symNum = BAR_LENGTH,</div><div class="line">    .invert = <span class="keyword">false</span>,</div><div class="line">    .pixMap = (uint32_t*)barGraphPixMap,</div><div class="line">    .font   = NULL</div><div class="line">};</div></div><!-- fragment --><div class="fragment"><div class="line">    uint32_t barGraphValue = 3UL; <span class="comment">/* the value from 0 to barGraph.symNum */</span></div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Set a frame for the battery-shaped bar-graph display */</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__frame.html#gadf8be6669270e3846e4922fa464ff9b5">Cy_SegLCD_SetPixel</a>(LCD0, FRAME))</div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Write a bar graph starting from the first pixel of the barGraph display */</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__display.html#gaa2bced400ccffabc63955db22a8be09b">Cy_SegLCD_BarGraph</a>(LCD0, barGraphValue, 0UL, &amp;barGraph))</div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><p>after which the next image on the glass appears: </p><div class="image">
<img src="seglcd_bargraph.png" alt="seglcd_bargraph.png"/>
</div>
<p>Also, you can customize basic fonts, for example: </p><div class="fragment"><div class="line"><span class="comment">/* This is a customized ASCII-coded font for the basic 7-segment display: */</span></div><div class="line"><span class="keyword">const</span> uint8_t customAsciiFontMap7Seg[] =</div><div class="line">{</div><div class="line">  <span class="comment">/*space*/</span>         <span class="comment">/* Zeroes for all the unused symbols */</span>                     <span class="comment">/*  -  */</span></div><div class="line">    0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,0x40U,0x00U,0x00U,</div><div class="line">  <span class="comment">/*  0     1     2     3     4     5     6     7     8     9  */</span></div><div class="line">    0x3FU,0x06U,0x5BU,0x4FU,0x66U,0x6DU,0x7DU,0x07U,0x7FU,0x6FU,0x00U,0x00U,0x00U,0x00U,0x00U,0x00U,</div><div class="line">        <span class="comment">/*  A     B     C     D     E     F     G     H     I     J     K     L     M     N     O  */</span></div><div class="line">    0x00U,0x77U,0x7CU,0x39U,0x1FU,0x79U,0x71U,0x3DU,0x76U,0x06U,0x1EU,0x75U,0x38U,0x15U,0x37U,0x3FU,</div><div class="line">  <span class="comment">/*  P     Q     R     S     T     U     V     W     X     Y     Z  */</span></div><div class="line">    0x73U,0x67U,0x33U,0x6DU,0x07U,0x3EU,0x72U,0x2AU,0x64U,0x66U,0x5BU,0x00U,0x00U,0x00U,0x00U,0x00U,</div><div class="line">        <span class="comment">/*  a     b     c     d     e     f     g     h     i     j     k     l     m     n     o  */</span></div><div class="line">    0x00U,0x5FU,0x7CU,0x58U,0x5EU,0x7BU,0x71U,0x6FU,0x74U,0x04U,0x0EU,0x7AU,0x38U,0x15U,0x54U,0x5CU,</div><div class="line">  <span class="comment">/*  p     q     r     s     t     u     v     w     x     y     z  */</span></div><div class="line">    0x73U,0x67U,0x50U,0x6DU,0x78U,0x1CU,0x62U,0x2AU,0x52U,0x6EU,0x5BU</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__seglcd__font__t.html">cy_stc_seglcd_font_t</a> customAsciiFont7Seg =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__font__t.html#a3f2c5ab28c39155b7a5a8b4b0d1bb04f">first</a>   = <span class="charliteral">&#39; &#39;</span>,</div><div class="line">    .last    = <span class="charliteral">&#39;z&#39;</span>,</div><div class="line">    .ascii   = <span class="keyword">true</span>,</div><div class="line">    .fontMap = customAsciiFontMap7Seg</div><div class="line">};</div></div><!-- fragment --><p>And now you can write characters and strings on a standard 7-segment display: </p><div class="fragment"><div class="line">        <span class="comment">/* Scenario: Write characters so that there the word &#39;char&#39; is created */</span></div><div class="line">        <span class="comment">/* Set up the custom alphanumerical font for 7-segment display */</span></div><div class="line">        display.<a class="code" href="structcy__stc__seglcd__disp__t.html#a80a819d5a9bf227fab85187391c63c1c">font</a> = &amp;customAsciiFont7Seg; <span class="comment">/* Set up the alphanumerical font */</span></div><div class="line">        (void) <a class="code" href="group__group__seglcd__functions__display.html#ga0d15e83fe5da9ab3db8dffd02ce5b9aa">Cy_SegLCD_WriteChar</a>(LCD0, <span class="charliteral">&#39;c&#39;</span>, 0, &amp;display);</div><div class="line">        (void) <a class="code" href="group__group__seglcd__functions__display.html#ga0d15e83fe5da9ab3db8dffd02ce5b9aa">Cy_SegLCD_WriteChar</a>(LCD0, <span class="charliteral">&#39;h&#39;</span>, 1, &amp;display);</div><div class="line">        (void) <a class="code" href="group__group__seglcd__functions__display.html#ga0d15e83fe5da9ab3db8dffd02ce5b9aa">Cy_SegLCD_WriteChar</a>(LCD0, <span class="charliteral">&#39;a&#39;</span>, 2, &amp;display);</div><div class="line">        (void) <a class="code" href="group__group__seglcd__functions__display.html#ga0d15e83fe5da9ab3db8dffd02ce5b9aa">Cy_SegLCD_WriteChar</a>(LCD0, <span class="charliteral">&#39;r&#39;</span>, 3, &amp;display);</div></div><!-- fragment --><p>after which the next image on the glass appears: </p><div class="image">
<img src="seglcd_char.png" alt="seglcd_char.png"/>
</div>
 <div class="fragment"><div class="line">        <span class="comment">/* Scenario: Write a string starting at the most left symbol on display */</span></div><div class="line">        <a class="code" href="group__group__syslib__macros.html#ga40bb5262bf908c328fbcfbe5d29d0201">char_t</a> * <span class="keywordtype">string</span> = <span class="stringliteral">&quot;Font&quot;</span>;</div><div class="line">        <span class="comment">/* Set up the custom alphanumerical font for 7-segment display */</span></div><div class="line">        display.<a class="code" href="structcy__stc__seglcd__disp__t.html#a80a819d5a9bf227fab85187391c63c1c">font</a> = &amp;customAsciiFont7Seg;</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__display.html#ga88ff08e5e824bc0d771bc98dbcfdaa5d">Cy_SegLCD_WriteString</a>(LCD0, <span class="keywordtype">string</span>, 0, &amp;display))</div><div class="line">        {</div><div class="line">            <span class="comment">/* error handling */</span></div><div class="line">        }</div></div><!-- fragment --><div class="image">
<img src="seglcd_font.png" alt="seglcd_font.png"/>
</div>
<p>Also, you can customize or create your own displays, for example: </p><div class="fragment"><div class="line"><span class="comment">/* This is a custom 3x5 dot matrix display</span></div><div class="line"><span class="comment"> * (which is made from the standard 5x8 dot matrix just cutting all the redundant pixels):</span></div><div class="line"><span class="comment"> */</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define CUSTOM_DISP_3x5DM_TYPE                (3 * 5) </span><span class="comment">/* Amount of pixels in single 3x5 symbol */</span><span class="preprocessor"></span></div><div class="line"> </div><div class="line"><span class="keyword">const</span> uint32_t commonsDm[] =</div><div class="line">{</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_3, 0UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_4, 1UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_5, 2UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_6, 3UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_0, 4UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_1, 5UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P10_3, 6UL),</div><div class="line">    <a class="code" href="group__group__seglcd__macros.html#ga5da32950a854641868e98c302afe2fe5">CY_SEGLCD_COMMON</a>(LCD_P11_2, 7UL)</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> uint32_t display3x5PixMap[4][CUSTOM_DISP_3x5DM_TYPE] =</div><div class="line">{</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_1,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_1,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_1,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_1,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_1,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_2,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_2,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_2,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_2,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_2,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_3,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_3,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_3,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_3,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_3,  5UL)</div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_6,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_6,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_6,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_6,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_6,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_7,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_7,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_7,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_7,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_7,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_8,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_8,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_8,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_8,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_8,  5UL)</div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_11,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_11,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_11,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_11,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_11,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_12,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_12,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_12,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_12,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_12,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_13,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_13,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_13,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_13,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_13,  5UL)</div><div class="line">    },</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_16,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_16,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_16,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_16,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_16,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_17,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_17,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_17,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_17,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_17,  5UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_18,  1UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_18,  2UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_18,  3UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_18,  4UL),</div><div class="line">        <a class="code" href="group__group__seglcd__macros.html#gaacbf9913c4cf4341e7b0594f1069bab0">CY_SEGLCD_PIXEL</a>(LCD_DM_18,  5UL)</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__seglcd__disp__t.html">cy_stc_seglcd_disp_t</a> display3x5 =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__disp__t.html#a92e348e14cdae68278381927802b48fc">type</a>   = CUSTOM_DISP_3x5DM_TYPE,</div><div class="line">    .symNum = 4,</div><div class="line">    .invert = <span class="keyword">false</span>,</div><div class="line">    .pixMap = (uint32_t*)display3x5PixMap,</div><div class="line">    .font   = &amp;customNumericFont3x5</div><div class="line">};</div></div><!-- fragment --><p>And also different fonts for them: </p><div class="fragment"><div class="line"><span class="preprocessor">#define CUSTOM_DISP_3x5DM_FONT_SYM_SIZE       (CY_SYSLIB_DIV_ROUNDUP(CUSTOM_DISP_3x5DM_TYPE, CY_SEGLCD_OCTET)) </span><span class="comment">/* Size of the 3x5 font map array item in bytes */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="comment">/* Numeric font (numbers 0...F and blank symbol) */</span></div><div class="line"><span class="keyword">const</span> uint8_t customNumericFontMap3x5[][CUSTOM_DISP_3x5DM_FONT_SYM_SIZE] =</div><div class="line">{</div><div class="line">    <span class="comment">/*    0             1             2             3             4             5             6             7     */</span></div><div class="line">    {0x2EU,0x3AU},{0xF2U,0x43U},{0xB9U,0x4AU},{0xB1U,0x2AU},{0x87U,0x7CU},{0xB7U,0x26U},{0xAEU,0x26U},{0xA1U,0x0FU},</div><div class="line">    <span class="comment">/*    8             9             A             B             C             D             E             F           space  */</span></div><div class="line">    {0xAAU,0x2AU},{0xB2U,0x3AU},{0x3EU,0x79U},{0xBFU,0x2AU},{0x2EU,0x2AU},{0x3FU,0x3AU},{0xBFU,0x46U},{0xBFU,0x04U},{0x00U,0x00U}</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__seglcd__font__t.html">cy_stc_seglcd_font_t</a> customNumericFont3x5 =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__font__t.html#a3f2c5ab28c39155b7a5a8b4b0d1bb04f">first</a>   = 0,</div><div class="line">    .last    = <a class="code" href="group__group__seglcd__macros.html#gae162a7b29b2a8ff3078d016836f35214">CY_SEGLCD_NUM_BLANK</a>,</div><div class="line">    .ascii   = <span class="keyword">false</span>,</div><div class="line">    .fontMap = (uint8_t*)customNumericFontMap3x5</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">/* ASCII-coded limited font (symbols 0...9, A...F and space) */</span></div><div class="line"><span class="keyword">const</span> uint8_t customAsciiFontMap3x5[][CUSTOM_DISP_3x5DM_FONT_SYM_SIZE] =</div><div class="line">{</div><div class="line">    <span class="comment">/*  space  */</span> <span class="comment">/*         All zeroes (essentially the &#39;space&#39; characters) for all the unused symbols          */</span></div><div class="line">    {0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},</div><div class="line">    {0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},</div><div class="line">    <span class="comment">/*    0             1             2             3             4             5             6             7     */</span></div><div class="line">    {0x2EU,0x3AU},{0xF2U,0x43U},{0xB9U,0x4AU},{0xB1U,0x2AU},{0x87U,0x7CU},{0xB7U,0x26U},{0xAEU,0x26U},{0xA1U,0x0FU},</div><div class="line">    <span class="comment">/*    8             9    */</span></div><div class="line">    {0xAAU,0x2AU},{0xB2U,0x3AU},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},{0x00U,0x00U},</div><div class="line">                  <span class="comment">/*    A             B             C             D             E             F    */</span></div><div class="line">    {0x00U,0x00U},{0x3EU,0x79U},{0xBFU,0x2AU},{0x2EU,0x2AU},{0x3FU,0x3AU},{0xBFU,0x46U},{0xBFU,0x04U}</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__seglcd__font__t.html">cy_stc_seglcd_font_t</a> customAsciiFont3x5 =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__seglcd__font__t.html#a3f2c5ab28c39155b7a5a8b4b0d1bb04f">first</a>   = <span class="charliteral">&#39; &#39;</span>,</div><div class="line">    .last    = <span class="charliteral">&#39;F&#39;</span>,</div><div class="line">    .ascii   = <span class="keyword">true</span>,</div><div class="line">    .fontMap = (uint8_t*)customAsciiFontMap3x5</div><div class="line">};</div></div><!-- fragment --><p>And now use all that together: </p><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Write a hexadecimal number 43 981 (0xABCD): */</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__seglcd__enums.html#ggaf81660a051e97187b6617ae3f709b047a3fac00a061e1cd84f5e0e13289944cb7">CY_SEGLCD_SUCCESS</a> != <a class="code" href="group__group__seglcd__functions__display.html#ga496bcaec24788a3dc0d81c8a1bac4064">Cy_SegLCD_WriteNumber</a>(LCD0, 43981, 3, &amp;display3x5, <span class="keyword">false</span>, <span class="keyword">true</span>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* error handling */</span></div><div class="line">    }</div></div><!-- fragment --><div class="image">
<img src="seglcd_3x5.png" alt="seglcd_3x5.png"/>
</div>
<p>There are LCD-GPIO terminal mapping definitions for different device families used in the mentioned above commons and display pixel arrays: </p><div class="fragment"><div class="line"><span class="preprocessor">#if defined P13_0_PORT</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_3 11UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_4 12UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_7 15UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_0 16UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_1 17UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_2 18UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_3 19UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_4 20UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_5 21UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_6 22UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_0 23UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_1 24UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_2 25UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_3 26UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_4 27UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_5 28UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_6 29UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_7 30UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_0 31UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_1 32UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_2 33UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_3 34UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_4 35UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_5 36UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_6 37UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P13_7 38UL</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_COM_0 LCD_P13_0</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_1 LCD_P13_1</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_2 LCD_P13_2</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_3 LCD_P13_3</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_4 LCD_P13_4</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_5 LCD_P13_5</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_6 LCD_P13_6</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_7 LCD_P13_7</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_SEG_6 LCD_P12_1</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_5 LCD_P12_2</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_4 LCD_P12_3</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_3 LCD_P12_4</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_2 LCD_P12_5</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_DM_2  LCD_P12_2</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_3  LCD_P12_3</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_12 LCD_P13_0</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_13 LCD_P13_1</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_16 LCD_P13_4</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_17 LCD_P13_5</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_18 LCD_P13_6</span></div><div class="line"><span class="preprocessor">#else </span><span class="comment">/* Another LCD-GPIO mapping for CY8C62x5 device family */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define LCD_P2_0   6UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_1   7UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_2   8UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_3   9UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_4  10UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_5  11UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_6  12UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P2_7  13UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_3 47UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_4 48UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P10_7 51UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_0 52UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_1 53UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_2 54UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_3 55UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_4 56UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_5 57UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P11_6 58UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_0  0UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_1  1UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_6  2UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P12_7  3UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P6_0  20UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P6_1  21UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P6_2  22UL</span></div><div class="line"><span class="preprocessor">    #define LCD_P6_3  23UL</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_COM_0 LCD_P2_0</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_1 LCD_P2_1</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_2 LCD_P2_2</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_3 LCD_P2_3</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_4 LCD_P2_4</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_5 LCD_P2_5</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_6 LCD_P2_6</span></div><div class="line"><span class="preprocessor">    #define LCD_COM_7 LCD_P2_7</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_SEG_6 LCD_P12_1</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_5 LCD_P6_0</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_4 LCD_P6_1</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_3 LCD_P6_2</span></div><div class="line"><span class="preprocessor">    #define LCD_SEG_2 LCD_P6_3</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_DM_2  LCD_P6_0</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_3  LCD_P6_1</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_12 LCD_P2_0</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_13 LCD_P2_1</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_16 LCD_P2_4</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_17 LCD_P2_5</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_18 LCD_P2_6</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define LCD_DM_1  LCD_P12_1</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_6  LCD_P12_6</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_7  LCD_P12_7</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_8  LCD_P10_4</span></div><div class="line"><span class="preprocessor">    #define LCD_DM_11 LCD_P10_7</span></div></div><!-- fragment --> <h1><a class="anchor" id="group_seglcd_more_information"></a>
More Information</h1>
<p>Refer to the technical reference manual (TRM) and the device datasheet.</p>
<h1><a class="anchor" id="group_seglcd_changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>1.10.1 </td><td>Updated note about include cycfg_seglcd.h </td><td>User experience improvement  </td></tr>
<tr>
<td>1.10 </td><td>Fixed/Documented MISRA 2012 violations. </td><td>MISRA 2012 compliance.  </td></tr>
<tr>
<td>1.0.1 </td><td>Code snippets are extended to support the CY8C62x5 device family </td><td>User experience improvement  </td></tr>
<tr>
<td>1.0 </td><td>Initial version </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__seglcd__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__seglcd__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__seglcd__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__seglcd__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__seglcd__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__seglcd__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__seglcd__globals"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__seglcd__globals.html">Global   Data</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__seglcd__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__seglcd__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
